import request from '@/config/axios'

// 热门搜索 VO
export interface HotSearchVO {
  id: number // 主键
  title: string // 热门搜索
  sort: number // 显示顺序
}

// 热门搜索 API
export const HotSearchApi = {
  // 查询热门搜索分页
  getHotSearchPage: async (params: any) => {
    return await request.get({ url: `/system/hot-search/page`, params })
  },

  // 查询热门搜索详情
  getHotSearch: async (id: number) => {
    return await request.get({ url: `/system/hot-search/get?id=` + id })
  },

  // 新增热门搜索
  createHotSearch: async (data: HotSearchVO) => {
    return await request.post({ url: `/system/hot-search/create`, data })
  },

  // 修改热门搜索
  updateHotSearch: async (data: HotSearchVO) => {
    return await request.put({ url: `/system/hot-search/update`, data })
  },

  // 删除热门搜索
  deleteHotSearch: async (id: number) => {
    return await request.delete({ url: `/system/hot-search/delete?id=` + id })
  },

  // 导出热门搜索 Excel
  exportHotSearch: async (params) => {
    return await request.download({ url: `/system/hot-search/export-excel`, params })
  }
}